package com.bird.jdk.内部类.内部类的继承;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

/**
 * @author sijunqiang
 * @data 2021/4/8 8:11
 * @description: 模拟内部类的继承
 */
public class WithInner {
    // 定义一个内部类
      class Inner{
       public void sout(){
           System.out.println("内部类的调用");
       }
    }
}
// 内部类的继承 必须在构造器中 使用 super()来初始化内部类 否则的化不能编译
  class InheritInner extends WithInner.Inner {
    InheritInner(WithInner withInner){
      withInner.super();
    }

    public static void main(String[] args) {
        WithInner withInner = new WithInner();
        InheritInner inheritInner = new InheritInner(withInner);
        inheritInner.sout();
    }

}
